home *** CD-ROM | disk | FTP | other *** search
- EXPLOD 2.03
- PURPOSE
- EXPLOD is a fireworks program for the Hercules, VGA, EGA, or CGA
- graphics cards.
-
- FILES
- run.bat - run this if you don't want to read the rest of this
- explod.doc - this file
- explod.exe - program to display fireworks
- *.dat - explosion data files
- expgen.exe - program to generate explosion data files
- explod.c - fireworks display main source code
- expa.asm - fireworks display support routines
- maketc.bat - compile script for use with Turbo C and MASM
- expgen.c - data file generator source code
- example.c - example of how to generate data files
- star.tra - star transformation data file
- expgdemo.bat - demo that shows how to use expgen.exe
-
- HOW TO RUN
- The command format is:
-
- explod [optional parameters] <data files>
-
- Optional parameters can be one of:
-
- -vC :C = Video type. CGA:'-vc' HGC:'-vh' EGA:'-ve' VGA:'-vv'
- Default is auto-detect. VGA users should use -ve for the
- best results with the supplied data files.
-
- -sN :N = # of simultaneous explosions on the screen at a time.
- Default: 10 (8 for CGA). This parameter controls how often
- explosions are created.
-
- -dN :N = Delay factor. Default: 0
- The delay to use depends on the machine speed and the number
- of simultaneous explosions (see -s). Typical values when 10
- simultaneous explosions are used are 0 for a 8Mhz XT and 6 for
- a 12 Mhz AT.
-
- -nN :N = Number of explosions to display before exiting. Default=0.
- 0 means infinite. Use a small value for this parameter in order
- to turn this program into a fancy screen clearer.
-
- -gN :N = Gravity. Default: CGA=15 HGC=20 EGA=20
- This parameter is used to override the gravity values specified
- in the data files. Gravity is the vertical acceleration acting
- on the particles in an explosion. Negative gravity values
- (eg. "-g-50") are allowed; they cause acceleration upwards.
-
- -wN :N = Wind. Default: 0 Typical Values: -50 to 50
- Wind is the horizontal acceleration acting on the particles in
- an explosion. Positive values blow to the right and negative
- values blow to the left.
-
- -f :Fill screen with explosion trails. This creates a screen
- full of multicoloured dots for those who like such things.
-
- Keyboard Control:
-
- Pressing ESCAPE will exit the program. Pressing any other key will
- cause an additional explosion to be started. The position of the
- explosion roughly corresponds to the position of the key on the
- keyboard; the space bar will start an explosion at a random place.
- NOTE: if you use DOS 3.2 and you pound on the keys too fast then
- you may get a DOS stack overflow error which will lock up
- your machine.
-
- Examples:
- explod round.dat (single explosion type, 8MHz XT)
- explod -s5 -t3 round.dat diag.dat (4.77MHz XT with CGA)
- explod -t10 -s15 *.dat (for 8MHz 80186 XT with HGC)
- explod -s10 -w1000 *.dat (for 8 Mhz AT with EGA)
- explod -ve -w20 -d6 *.dat (for 12 Mhz AT with VGA)
- explod -s0 *.dat (full manual control of all explosions)
- explod -s50 -n5 -d10 round.dat (use as a screen clearer)
-
- A summary of these instructions is displayed briefly if the program
- is run without any parameters.
-
- DATA FILE FORMAT
- Each data file describes the structure of one type of explosion.
- They are pure ascii files that can be manually created with an text
- editor, generated by the program expgen.exe, or generated by simple
- programs that you write in the language of your choice.
-
- An explosions consists of a set of points moving from their source
- positions to their destination positions. The data file gives the
- number of points, the number of frames (steps) to animate the
- explosion in, the vertical and horizontal accelerations (gravity
- and wind), and the trail length (each point leaves a trail as it
- moves).
-
- In addition to the specified accerlerations, each point has an
- initial velocity towards its destination and a constant deceleration
- away from the destination. These are calculated such that the point
- will have zero velocity when it reaches its destination in the
- given number of frames (time units). (The equations used are
- distance = 0.5 * accel * time^2, and velocity_change = accel * time.)
-
- The following is an example of a data file:
-
- # EXPLOD DATA FILE
- 300 # Number of points (max is 420)
- 50 # Number of frames (max is 80)
- 9 # Gravity
- 0 # Wind
- 5 # Trail length
- 0 0 -39 4
- 0 0 40 -33
- 0 0 -45 -16
- ...296 more lines like these
- 0 0 -68 47
-
- The first line of the data file must start with the string
- "# EXPLOD DATA FILE". The next 5 lines give the explosion
- parameters. Each following line contains a source (x,y) and
- destination (x,y) locations of one point. There should be the
- same number of these src-dest lines as the number specified in the
- second line of the file. Each x-y value represents a location
- in Cartesian coordinates with the centre of the explosion being
- (0,0). Values are in units of screen pixels.
-
- For example, consider the following four explosion points:
-
- 0 0 12 3
- 0 0 8 -2
- 0 0 -5 2
- 0 0 -7 -3
-
- Their relative screen positions would be as follows (the centre of
- the explosion is (0,0)):
-
- |
- | (12,3)
- (-5,2) | .
- . |
- |(0,0)
- --------------+--------------
- |
- (-7,-3) | . (8,-2)
- . |
- |
-
- Comments can follow the numbers on any of the lines. (The example
- uses a '#' delimiter, but none is actually required).
-
- For example, to generate an 'explosion' that consists of the four
- points at the corners of a square imploding into their centre, the
- following data file can be used:
-
- # EXPLOD DATA FILE
- 4 Number of points in the explosion
- 60 Number of frames
- 9 Gravity
- 0 Wind
- 10 Trail length
- -100 100 0 0
- 100 100 0 0
- 100 -100 0 0
- -100 -100 0 0
-
- It is often easier to generate data files for geometric-shaped
- explosions by writing a program instead of entering each point
- by hand. See the file expgen.c for an example of such a program.
- You should be able to use any language of your choice as long
- as your output matches this file format.
-
- By giving the appropriate source and destination locations of
- each point, other types of point-based animations can be created.
- The supplied data file star.tra is an example: it animates a
- transformation of a horizontal-vertical star into a diagonal star.
-
- HOW TO COMPILE
- As distributed, the code is compilable with Turbo C and MASM using
- the MAKETC.BAT file. Turbo C 1.5, 2.0 and MASM 5.0 were tested, but
- other versions should work as well.
-
- The code was developed with Datalight C 2.20 and Arrowsoft ASM 1.00d.
- To compile in this environment, comment out the 'TURBOC equ 1' line and
- uncomment the 'DLC equ 1' line in the file EXPA.ASM before compiling.
-
- To use with other compilers, the segment and group names should be
- redefined according to the compiler's manual. A generic command
- sequence to make the executable would be:
-
- masm /mx expa ;
- cc explod.c expa.obj
-
- BUGS/MISFEATURES
- - With some machines running under DOS 3.2, if a lot of keys are
- pressed in a very short time (such as when you press your hand
- on the keyboard), the DOS message "FATAL: stack failure" appears
- (if your BIOS can print text in graphics mode) and the machine
- will lock up. To recover, press the reset button if there is one
- or turn the machine off and on. To avoid this problem, either
- don't hit the keys so fast next time, change to a different version
- of DOS, or change your machine (here's the excuse that you've been
- looking for for getting that 386 box :-).
- - Explosions "wrap around" on the four edges of the screen.
- - The program allocates all available memory from DOS when it starts
- (if you don't like this then set a limit in MemInit() in explod.c).
- - This program has not been tested much in CGA mode, so the supplied
- demos and default parameters may not be very good on a CGA system.
-
- AUTHOR
- If you have any questions or comments, send them to:
-
- Dennis Lo Internet: dlo@ubc-idacom.cs.ubc.ca
- 4516 Albert St. or
- Burnaby, B.C. ...!alberta!ubc-cs!idacom!dlo
- Canada V5C 2G5
-
- Send me your favourite set of command line parameters and/or data
- files and I'll put it into the next release.
-
- Special thanks goes to:
- - Erik Liljencrantz, for sending me his EGA/VGA modifications.
- - Dave Lo, for the 'trails' suggestion and the use of his
- VGA machine and his Turbo C.
-
- LICENCE
- This is free software, not shareware.
-
- You are free to use and distribute unmodified copies of this program.
- Modified versions of the source and executable may only be distributed
- if they are clearly distinguished from the originals with descriptive
- messages.